angular.module('ted', [
    'ted.controller',
    'ted.mgt-controller',
    'ted.service',
    'ted.mgt-service',    
    'ngRoute',
    'angularFileUpload',
    'ngSanitize',
    'btford.markdown'
    ])
.config(['$routeProvider', function ($routeProvider) {
    $routeProvider.when('/topic/:id', 
      {
        templateUrl: 'tpl/topic.tpl.html', 
        controller: 'TopicController'
      });  
    $routeProvider.when('/topics', 
      {
        templateUrl: 'tpl/topics.tpl.html', 
        controller: 'TopicsController'
      });   
    $routeProvider.when('/tag/:tag', 
      {
        templateUrl: 'tpl/topics.tpl.html', 
        controller: 'TagController'
      });      
    //mgt
    $routeProvider.when('/mgt/newtopic', 
      {
        templateUrl: 'tpl/mgt-newtopic.tpl.html', 
        controller: 'MgtNewTopicController'
      });           
    $routeProvider.when('/mgt/topics', 
      {
        templateUrl: 'tpl/mgt-topics.tpl.html', 
        controller: 'MgtTopicsController'
      });     
    $routeProvider.when('/mgt/topic/:tid/enroll', 
      {
        templateUrl: 'tpl/mgt-enrolls.tpl.html', 
        controller: 'MgtEnrollsController'
      });           
              
    $routeProvider.otherwise({redirectTo: '/topic/hot'});
}])
.config(['$locationProvider', function($locationProvider) {
  $locationProvider.hashPrefix('!');
  // $locationProvider.html5Mode(true);
}]);
